package cn.shadow.game.chess.CHnchess.board;


import cn.shadow.proto.client.CHnChessClientProtoContent;

public class ChessMover implements Mover {

   private Position src;
   private Position target;

    public ChessMover(Position src, Position target) {
        this.src = src;
        this.target = target;
    }

    @Override
    public Position srcPosition() {
        return src;
    }

    @Override
    public Position targetPosition() {
        return target;
    }

    @Override
    public CHnChessClientProtoContent.ChessMoverMsg moverMsg() {
        CHnChessClientProtoContent.ChessMoverMsg.Builder builder = CHnChessClientProtoContent.ChessMoverMsg.newBuilder();
        builder.setSrc((CHnChessClientProtoContent.ChessNode) src.chessNodeMsg());
        builder.setSrc((CHnChessClientProtoContent.ChessNode) target.chessNodeMsg());
        return builder.build();
    }


}
